Integrand size = 18, antiderivative size = 127 \[ \int (c+d x) (a+b \tanh (e+f x))^2 \, dx=b^2 c x+\frac {1}{2} b^2 d x^2+\frac {a^2 (c+d x)^2}{2 d}-\frac {a b (c+d x)^2}{d}+\frac {2 a b (c+d x) \log \left (1+e^{2 (e+f x)}\right )}{f}+\frac {b^2 d \log (\cosh (e+f x))}{f^2}+\frac {a b d \operatorname {PolyLog}\left (2,-e^{2 (e+f x)}\right )}{f^2}-\frac {b^2 (c+d x) \tanh (e+f x)}{f} \]
b^2*c*x+1/2*b^2*d*x^2+1/2*a^2*(d*x+c)^2/d-a*b*(d*x+c)^2/d+2*a*b*(d*x+c)*ln (1+exp(2*f*x+2*e))/f+b^2*d*ln(cosh(f*x+e))/f^2+a*b*d*polylog(2,-exp(2*f*x+ 2*e))/f^2-b^2*(d*x+c)*tanh(f*x+e)/f
Time = 6.79 (sec) , antiderivative size = 214, normalized size of antiderivative = 1.69 \[ \int (c+d x) (a+b \tanh (e+f x))^2 \, dx=\frac {\cosh (e+f x) \left (-\left (\left (a^2+b^2\right ) (e+f x) (-2 c f+d (e-f x)) \cosh (e+f x)\right )+2 b \cosh (e+f x) \left (\frac {a f^2 (c+d x)^2}{d}+b d (e+f x)-2 (b d-2 a d e+2 a c f) (e+f x)+2 a d (e+f x) \log \left (1+e^{-2 (e+f x)}\right )+(b d-2 a d e+2 a c f) \log \left (1+e^{2 (e+f x)}\right )-a d \operatorname {PolyLog}\left (2,-e^{-2 (e+f x)}\right )\right )-2 b^2 f (c+d x) \sinh (e+f x)\right ) (a+b \tanh (e+f x))^2}{2 f^2 (a \cosh (e+f x)+b \sinh (e+f x))^2} \]
(Cosh[e + f*x]*(-((a^2 + b^2)*(e + f*x)*(-2*c*f + d*(e - f*x))*Cosh[e + f* x]) + 2*b*Cosh[e + f*x]*((a*f^2*(c + d*x)^2)/d + b*d*(e + f*x) - 2*(b*d - 2*a*d*e + 2*a*c*f)*(e + f*x) + 2*a*d*(e + f*x)*Log[1 + E^(-2*(e + f*x))] + (b*d - 2*a*d*e + 2*a*c*f)*Log[1 + E^(2*(e + f*x))] - a*d*PolyLog[2, -E^(- 2*(e + f*x))]) - 2*b^2*f*(c + d*x)*Sinh[e + f*x])*(a + b*Tanh[e + f*x])^2) /(2*f^2*(a*Cosh[e + f*x] + b*Sinh[e + f*x])^2)
Time = 0.42 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3042, 4205, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (c+d x) (a+b \tanh (e+f x))^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (c+d x) (a-i b \tan (i e+i f x))^2dx\) |
\(\Big \downarrow \) 4205 |
\(\displaystyle \int \left (a^2 (c+d x)+2 a b (c+d x) \tanh (e+f x)+b^2 (c+d x) \tanh ^2(e+f x)\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {a^2 (c+d x)^2}{2 d}+\frac {2 a b (c+d x) \log \left (e^{2 (e+f x)}+1\right )}{f}-\frac {a b (c+d x)^2}{d}+\frac {a b d \operatorname {PolyLog}\left (2,-e^{2 (e+f x)}\right )}{f^2}-\frac {b^2 (c+d x) \tanh (e+f x)}{f}+\frac {b^2 (c+d x)^2}{2 d}+\frac {b^2 d \log (\cosh (e+f x))}{f^2}\) |
(a^2*(c + d*x)^2)/(2*d) - (a*b*(c + d*x)^2)/d + (b^2*(c + d*x)^2)/(2*d) + (2*a*b*(c + d*x)*Log[1 + E^(2*(e + f*x))])/f + (b^2*d*Log[Cosh[e + f*x]])/ f^2 + (a*b*d*PolyLog[2, -E^(2*(e + f*x))])/f^2 - (b^2*(c + d*x)*Tanh[e + f *x])/f
3.1.60.3.1 Defintions of rubi rules used
Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.) , x_Symbol] :> Int[ExpandIntegrand[(c + d*x)^m, (a + b*Tan[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[m, 0] && IGtQ[n, 0]
Time = 0.27 (sec) , antiderivative size = 221, normalized size of antiderivative = 1.74
method | result | size |
risch | \(\frac {a^{2} d \,x^{2}}{2}-a b d \,x^{2}+\frac {b^{2} d \,x^{2}}{2}+a^{2} c x +2 a b c x +b^{2} c x +\frac {2 \left (d x +c \right ) b^{2}}{f \left (1+{\mathrm e}^{2 f x +2 e}\right )}+\frac {b^{2} d \ln \left (1+{\mathrm e}^{2 f x +2 e}\right )}{f^{2}}-\frac {2 b^{2} d \ln \left ({\mathrm e}^{f x +e}\right )}{f^{2}}+\frac {2 b a c \ln \left (1+{\mathrm e}^{2 f x +2 e}\right )}{f}-\frac {4 b a c \ln \left ({\mathrm e}^{f x +e}\right )}{f}+\frac {4 b e d a \ln \left ({\mathrm e}^{f x +e}\right )}{f^{2}}-\frac {4 b d a e x}{f}-\frac {2 b d a \,e^{2}}{f^{2}}+\frac {2 b d a \ln \left (1+{\mathrm e}^{2 f x +2 e}\right ) x}{f}+\frac {a b d \operatorname {polylog}\left (2, -{\mathrm e}^{2 f x +2 e}\right )}{f^{2}}\) | \(221\) |
1/2*a^2*d*x^2-a*b*d*x^2+1/2*b^2*d*x^2+a^2*c*x+2*a*b*c*x+b^2*c*x+2/f*(d*x+c )*b^2/(1+exp(2*f*x+2*e))+1/f^2*b^2*d*ln(1+exp(2*f*x+2*e))-2/f^2*b^2*d*ln(e xp(f*x+e))+2/f*b*a*c*ln(1+exp(2*f*x+2*e))-4/f*b*a*c*ln(exp(f*x+e))+4/f^2*b *e*d*a*ln(exp(f*x+e))-4/f*b*d*a*e*x-2/f^2*b*d*a*e^2+2/f*b*d*a*ln(1+exp(2*f *x+2*e))*x+a*b*d*polylog(2,-exp(2*f*x+2*e))/f^2
Result contains complex when optimal does not.
Time = 0.30 (sec) , antiderivative size = 944, normalized size of antiderivative = 7.43 \[ \int (c+d x) (a+b \tanh (e+f x))^2 \, dx=\text {Too large to display} \]
1/2*((a^2 - 2*a*b + b^2)*d*f^2*x^2 + 4*a*b*d*e^2 + 2*(a^2 - 2*a*b + b^2)*c *f^2*x - 4*b^2*d*e + ((a^2 - 2*a*b + b^2)*d*f^2*x^2 + 4*a*b*d*e^2 - 8*a*b* c*e*f - 4*b^2*d*e - 2*(2*b^2*d*f - (a^2 - 2*a*b + b^2)*c*f^2)*x)*cosh(f*x + e)^2 + 2*((a^2 - 2*a*b + b^2)*d*f^2*x^2 + 4*a*b*d*e^2 - 8*a*b*c*e*f - 4* b^2*d*e - 2*(2*b^2*d*f - (a^2 - 2*a*b + b^2)*c*f^2)*x)*cosh(f*x + e)*sinh( f*x + e) + ((a^2 - 2*a*b + b^2)*d*f^2*x^2 + 4*a*b*d*e^2 - 8*a*b*c*e*f - 4* b^2*d*e - 2*(2*b^2*d*f - (a^2 - 2*a*b + b^2)*c*f^2)*x)*sinh(f*x + e)^2 - 4 *(2*a*b*c*e - b^2*c)*f + 4*(a*b*d*cosh(f*x + e)^2 + 2*a*b*d*cosh(f*x + e)* sinh(f*x + e) + a*b*d*sinh(f*x + e)^2 + a*b*d)*dilog(I*cosh(f*x + e) + I*s inh(f*x + e)) + 4*(a*b*d*cosh(f*x + e)^2 + 2*a*b*d*cosh(f*x + e)*sinh(f*x + e) + a*b*d*sinh(f*x + e)^2 + a*b*d)*dilog(-I*cosh(f*x + e) - I*sinh(f*x + e)) - 2*(2*a*b*d*e - 2*a*b*c*f - b^2*d + (2*a*b*d*e - 2*a*b*c*f - b^2*d) *cosh(f*x + e)^2 + 2*(2*a*b*d*e - 2*a*b*c*f - b^2*d)*cosh(f*x + e)*sinh(f* x + e) + (2*a*b*d*e - 2*a*b*c*f - b^2*d)*sinh(f*x + e)^2)*log(cosh(f*x + e ) + sinh(f*x + e) + I) - 2*(2*a*b*d*e - 2*a*b*c*f - b^2*d + (2*a*b*d*e - 2 *a*b*c*f - b^2*d)*cosh(f*x + e)^2 + 2*(2*a*b*d*e - 2*a*b*c*f - b^2*d)*cosh (f*x + e)*sinh(f*x + e) + (2*a*b*d*e - 2*a*b*c*f - b^2*d)*sinh(f*x + e)^2) *log(cosh(f*x + e) + sinh(f*x + e) - I) + 4*(a*b*d*f*x + a*b*d*e + (a*b*d* f*x + a*b*d*e)*cosh(f*x + e)^2 + 2*(a*b*d*f*x + a*b*d*e)*cosh(f*x + e)*sin h(f*x + e) + (a*b*d*f*x + a*b*d*e)*sinh(f*x + e)^2)*log(I*cosh(f*x + e)...
\[ \int (c+d x) (a+b \tanh (e+f x))^2 \, dx=\int \left (a + b \tanh {\left (e + f x \right )}\right )^{2} \left (c + d x\right )\, dx \]
\[ \int (c+d x) (a+b \tanh (e+f x))^2 \, dx=\int { {\left (d x + c\right )} {\left (b \tanh \left (f x + e\right ) + a\right )}^{2} \,d x } \]
1/2*a^2*d*x^2 + (x^2 - 4*integrate(x/(e^(2*f*x + 2*e) + 1), x))*a*b*d + b^ 2*c*(x + e/f - 2/(f*(e^(-2*f*x - 2*e) + 1))) + a^2*c*x + 1/2*b^2*d*((f*x^2 + (f*x^2*e^(2*e) - 4*x*e^(2*e))*e^(2*f*x))/(f*e^(2*f*x + 2*e) + f) + 2*lo g((e^(2*f*x + 2*e) + 1)*e^(-2*e))/f^2) + 2*a*b*c*log(cosh(f*x + e))/f
\[ \int (c+d x) (a+b \tanh (e+f x))^2 \, dx=\int { {\left (d x + c\right )} {\left (b \tanh \left (f x + e\right ) + a\right )}^{2} \,d x } \]
Timed out. \[ \int (c+d x) (a+b \tanh (e+f x))^2 \, dx=\int {\left (a+b\,\mathrm {tanh}\left (e+f\,x\right )\right )}^2\,\left (c+d\,x\right ) \,d x \]